package hy.config;

import com.netflix.loadbalancer.IRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class ConfigBean {
    @Bean//HttpClient
    @LoadBalanced
    public RestTemplate getTmp(){
        return new RestTemplate();
    }

    @Bean
    public IRule rule(){
        //return new RoundRobinRule();
//        return new RandomRule();
//        return new RetryRule();
//        return new BestAvailableRule();
        return new ReThreeRule();
    }
}